package cn.getech.data.development.service.impl;

import cn.getech.data.development.entity.ConnectFieldInfo;
import cn.getech.data.development.mapper.ConnectFieldInfoMapper;
import cn.getech.data.development.service.ConnectFieldInfoService;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConnectFieldInfoServiceImpl extends ServiceImpl<ConnectFieldInfoMapper, ConnectFieldInfo> implements ConnectFieldInfoService {
    @Override
    public void saveConnectFieldInfos(List<ConnectFieldInfo> list,Integer connectId) {
        if (CollectionUtil.isNotEmpty(list)) {
            for (ConnectFieldInfo fieldInfo : list
            ) {
                fieldInfo.setConnectId(connectId);
            }
            this.saveBatch(list);
        }
    }
}
